FROM python:3.6.8

ENV PYTHONUNBUFFERED 1
ENV DJANGO_ENV dev
ENV DOCKER_CONTAINER 1


RUN mkdir ~/.pip
RUN touch ~/.pip/pip.conf
RUN echo "[global]">>~/.pip/pip.conf
RUN echo "index-url=https://mirrors.aliyun.com/pypi/simple/">>~/.pip/pip.conf
RUN echo "trusted-host=mirrors.aliyun.com">>~/.pip/pip.conf
RUN pip install --upgrade pip

COPY .  /code/
WORKDIR /code/
RUN pip install -r requirements.txt

# create unprivileged user
RUN adduser --disabled-password --gecos '' myuser 
EXPOSE 8000 8800